//
//  ZWHomeFunctionCell.m
//  QuickCure1
//
//  Created by Apple on 16/11/1.
//  Copyright © 2016年 maoge. All rights reserved.
//

#import "ZWHomeFunctionCell.h"
#import "HMHomeFunctionModel.h"

@interface ZWHomeFunctionCell ()


@property (weak, nonatomic) IBOutlet UILabel *lb_name;
@end

@implementation ZWHomeFunctionCell

-(void)awakeFromNib{
    [super awakeFromNib];
    
}

-(void)setModel:(HMHomeFunctionModel *)model{
    
    _model = model;
    self.iv_icon.image = [UIImage imageNamed:model.icon];
    self.lb_name.text = model.name;
    
//    [self setIv_iconAnimation];
    
}
-(void)setIv_iconAnimation{
    
    NSTimer *timer = [NSTimer timerWithTimeInterval: 1 repeats:YES block:^(NSTimer * _Nonnull timer) {
        
                CABasicAnimation *am = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
        
                //2.设置属性
        
                am.toValue = @(1.8);
                am.repeatCount = 2 ;
                am.duration = 1;
        
        
                //添加
        
                [ self.iv_icon.layer addAnimation:am forKey:nil];
        
    }];
    
    [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
    
}

@end
